package com.kaviddiss.bootquartz.bean;

import org.quartz.JobKey;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Studio on 2017/5/20.
 *
 */
@Component
public class JobKeyModel {

    private Map<String,JobKey> jobKeyList;

    public JobKeyModel(){
        this.jobKeyList = new HashMap<String,JobKey>();
    }

    public Map<String, JobKey> getJobKeyList() {
        return jobKeyList;
    }

    public JobKey getJobKey(String key){
        if(jobKeyList.containsKey(key)){
            return jobKeyList.get(key);

        }else{
            return null;
        }
    }

    public JobKey deleteJobKey(String key){
        return jobKeyList.remove(key);
    }

    public void putJobKey(String jobName,JobKey jobKey){
        jobKeyList.put(jobName,jobKey);
    }

}
